<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class User extends Admin_page{
	
	function __construct() {
		parent::__construct();
		$this->load->model('user_model','user');
	}
	
	function index(){
		$this->list_user();
	}
	
	function list_user(){
		$data['list_user']=$this->user->get_all_user();
		$this->load->view('template/view_header');
		$this->load->view('template/view_menu');
		$this->load->view('user/list_user',$data);
		$this->load->view('template/view_footer');
	}
	
	function delete_user($nim){
		$this->user->delete_user($nim);
		redirect(USER);
	}
	
	function form_edit($nim){
		$data['user']=$this->user->get_user($nim);
	}
	
	function view_user($nim){
		$data_profil = $this->user->get_user($nim);
		$this->load->view('template/view_header');
		$this->load->view('template/view_menu');
		$this->load->view('home/show_profil',$data_profil);
		$this->load->view('template/view_footer');
	}
}
